Release 10.1A: OpenEdge Development:
Programming Interfaces
Using the CALL statement
Use the Progress 4GL
CALLstatement to execute a C function from a Progress procedure.The
CALLstatement has the following syntax:
The
routine-identifieris the name thePRODSP()dispatch routine maps to an actual C function. The routine identifier is case sensitive; it must have the same letter case as its definition in the dispatch routine.The
argumentis one or more arguments that you want to pass to the C function. Arguments passed to the C function must be read only. If you supply multiple arguments, separate them with spaces. If you separate them with other delimiters, such as commas, Progress passes the delimiters as arguments. Progress converts all arguments to C character strings before passing them to a C function; Progress passes them as an array of character pointers. Therefore, your C functions must expect null-terminated character strings and perform data conversions as necessary.Figure 18–3 demonstrates how to run the
CALLstatement.Figure 18–3: Running a CALL statement
![]()
The following
CALLstatement executeshlcroutine, the routine identifier for your C function:
When you use a
CALLstatement to invoke a routine that updates a shared buffer, you must make sure that a transaction is active at the time of the call. For more information, see the "Using a library function that writes to a shared buffer" section section.The
CALLstatement transfers control to the HLC dispatch routine,PRODSP(), passing it your routine identifier and any arguments. The example in Figure 18–3 passes the hlcroutine routine identifier with no arguments toPRODSP(), which is located inhlprodsp.c.You must modify the prototype
hlprodsp.cfile supplied with OpenEdge HLC to define your routine identifiers and C function names. Based on definitions you have set up inhlprodsp.c, thePRODSP()dispatch routine maps the routine identifier to your C function, and calls it. The example in Figure 18–3 maps hlcroutine to the functionhlcfunc().If the
PRODSP()dispatch routine does not define the routine identifier or defines it with a different letter case, an error results.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |